<template>
	<view>
		<view style="height: 2rpx;"></view>
		<view class="community-box" v-for="(item,index) in list" :key='index' style="margin-bottom: 20rpx;">
			<view
				style="padding: 30rpx 0;color: #262626;font-size: 28rpx;display: flex;justify-content: space-between;">
				<view>{{item.createtime_text}}</view>
				<view>{{item.status == 1 ? '已处理' : '待处理'}}</view>
			</view>
			<view class="building">
				<view class="flex align-center" style="padding: 20rpx 0;border-bottom: 1px solid #E5E5E5;" @tap="toApartment(item)">
					<image src="../../static/index/das-icon.png" style="width: 32rpx;height: 32rpx;"></image>
					<view style="flex: 1;color: #202020;font-size: 28rpx;padding-left: 18rpx;">{{item.apartment_title}}
					</view>
					<image src="../../static/index/zu210-2x.png" style="width: 24rpx;height: 24rpx;"></image>
				</view>
				<view class="flex" style="padding: 26rpx 0;" @tap="jump({url:'/pages/roomDetail/roomDetail?id='+item.room.id})">
					<image :src="item.room.thumb" style="width: 144rpx;height: 144rpx;border-radius: 8px;">
					</image>
					<view style="padding-left: 20rpx;">
						<view class="text-one" style="color: #202020;font-size: 28rpx;width: 400rpx;">
							{{item.room.title}}
						</view>
						<view style="color: #ABABAB;font-size: 24rpx;padding: 10rpx 0 20rpx 0;">{{item.room.size}}㎡ |
							{{item.room.toilet}} |
							{{item.room.bed}}
						</view>
						<view class="flex align-center">
							<text class="font-20 fw5" style="color: #C40E0E;">£</text>
							<text class="font-28 fw5"
								style="color: #C40E0E;margin-left: 6rpx;margin-right: 6rpx;">{{item.room.price}}</text>
							<text class="font-20 fw4 cl-88">/周</text>
						</view>
					</view>
				</view>
			</view>
			<block v-if="false">
				<view class="flex justify-between align-center"
					style="border-top: 1px solid #F9F9F9;padding-top: 30rpx;margin-top: 30rpx;" v-if="!item.status">
					<view style="color: #A1A1A1;font-size: 28rpx;"></view>
					<view class="button">取消申请</view>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			//公寓详情
			toApartment(item){
				this.jump({url:`/pages/apartmentDetail/apartmentDetail?id=${item.apartment_id}`})
			},
			getList() {
				this.$H.post(this.$api.get_mine_apply, {
					page: 1,
					pagesize: 20
				}, {
					token: true
				}).then(res => {
					console.log(res)
					this.list = res.data.list
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #F3F3F3;
	}

	.community-box {
		padding: 0 30rpx 30rpx 30rpx;
		background-color: #fff;

		.label {
			padding: 10rpx;
			font-size: 20rpx;
			font-weight: 400;
			color: #E99320;
			background: #FFECD2;
			border-radius: 10px 4px 9px 5px;
		}

		.remarks {
			padding-top: 36rpx;
			font-size: 28rpx;
			font-weight: 400;
			color: #262626
		}

		.condition {
			padding: 18rpx 0;
			font-size: 30rpx;
			font-weight: 400;
			color: #A1A1A1;
		}

		.building {
			padding: 0 20rpx;
			background: #F9F9F9;
			border-radius: 8px 8px 8px 8px;
		}

		.apartment {
			padding: 0 20rpx;
			background: #F9F9F9;
			border-radius: 8px 8px 8px 8px;
		}

		.apartment-box:last-child {
			border: none;
		}

		.button {
			padding: 20rpx 40rpx;
			font-size: 24rpx;
			font-weight: 400;
			color: #878787;
			border: 1px solid #C2C2C2;
			border-radius: 34px 34px 34px 34px;
		}
	}
</style>
